package com.xfcy.blog.controller.system;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xfcy.blog.annotation.OperationLogger;
import com.xfcy.blog.common.R;
import com.xfcy.blog.service.AdminLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (AdminLog)表控制层
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 10:59:51
 */
@RestController
@RequestMapping("system/adminLog")
@Api(tags = "操作日志")
public class AdminLogController {

    @Resource
    private AdminLogService adminLogService;

    @GetMapping("/list")
    @SaCheckLogin
    @ApiOperation(value = "操作日志列表", httpMethod = "GET", response = R.class, notes = "操作日志列表")
    public R list(Integer pageNo, Integer pageSize) {
        return adminLogService.listAdminLog(pageNo, pageSize);
    }

    @OperationLogger(value = "删除操作日志")
    @DeleteMapping("/delete")
    @SaCheckPermission("/system/adminLog/delete")
    @ApiOperation(value = "删除操作日志", httpMethod = "DELETE", response = R.class, notes = "删除操作日志")
    public R delete(@RequestBody List<Long> ids) {
        return adminLogService.deleteAdminLog(ids);
    }




}

